<?php
$this->breadcrumbs=array(
	'Cat Services'=>array('index'),
	'Manage',
);

$this->menu=array(
	array('label'=>'List CatService','url'=>array('index')),
	array('label'=>'Create CatService','url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('cat-service-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Quản lý chuyên mục dịch vụ</h1>



<?php $this->widget('bootstrap.widgets.TbGridView',array(
	'id'=>'cat-service-grid',
	#'dataProvider'=>$model->search(),
	'dataProvider'=>$model->getChildren(),
	'filter'=>$model,
	'columns'=>array(
		'id',
		'uk',
		'name',
		'name_en',
		'parent_id',
		'created_time',
		/*
		'enable',
		*/
		array(
			'class'=>'bootstrap.widgets.TbButtonColumn',
			'htmlOptions'=>array(
				'style'=>'width:100px;text-align:right;',
			),
		),
		array(
			'class'=>'bootstrap.widgets.TbButtonColumn',
			'htmlOptions'=>array(
            	'style'=>'width:100px;;text-align:right;',
			),
			'buttons'=>array(
					'up'=>array(
					'label'=>'Move Up',
					'icon'=>'icon-arrow-up',
					'url'=>'"#".$data->id',
					'htmlOptions'=>array(
						'entryId'=>''
					),
					'click'=>'function(e) {
						e.preventDefault();
						var id = $(this).attr("href");
						id = id.substr(1);
						$.post("'.$this->createUrl('moveUp').'", {id:id}, function(data, txtStatus) {
						$.fn.yiiGridView.update("children-entries-grid");
					});
					return false;
					}',
				),
			'down'=>array(
			'label'=>'Move Down',
					'icon'=>'icon-arrow-down',
					'url'=>'"#".$data->id',
					'htmlOptions'=>array(
					'entryId'=>''
			),
			'click'=>'function(e) {
						e.preventDefault();
						var id = $(this).attr("href");
						id = id.substr(1);
						$.post("'.$this->createUrl('moveDown').'", {id:id}, function(data, txtStatus) {
						$.fn.yiiGridView.update("children-entries-grid");
					});
			return false;
			}',
			),
			),

			'template'=>'{up}{down}|{view}{update}{delete}',
		),
	),
)); ?>
